FROM python:3.13.7-slim
ENV TZ=Asia/Shanghai
RUN pip install python-can==4.6.1

# https://python-can.readthedocs.io/en/stable/
# docker build -t  registry.cn-hangzhou.aliyuncs.com/xiaoyilin/can:4.6.1 .
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/can:4.6.1
# python can库提供Controller Area Network支持
# 为不同硬件设备提供通用抽象，提供一套用于在can总线上发送和接收消息的实用程序

# 宿主机加载vcan驱动模块
# modprobe vcan
# 宿主机创建虚拟CAN接口vcan0
# ip link add dev vcan0 type vcan
# ip link set vcan0 up
# 验证是否可用并处于在线状态
# ip addr | grep "can" 
# 测试虚拟CAN接口：can-utils工具测试
# 发送CAN帧：cansend vcan0 123
# 接收CAN数据：candump vcan0